package com.seckill.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seckill.admin.mapper.AdminMapper;
import com.seckill.admin.pojo.Admin;
import com.seckill.admin.service.AdminService;
import com.seckill.framework.mybatisplus.WrapperParse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 作者
 * @since 2022-03-09
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    /****
     * 根据名字查询管理员
     * @param username
     * @return
     */
    @Override
    public Admin findByName(String username) {
        QueryWrapper<Admin> wrapper = WrapperParse.simpleColumn("login_name", username);
        return adminMapper.selectOne(wrapper);
    }
}
